﻿<%@ Page Title="Welcome to the South Carolina Electronic Records Archive" Language="C#" MasterPageFile="~/MasterPages/MasterPageSrch.master" AutoEventWireup="true" CodeFile="ViewAllItems.aspx.cs" Inherits="Browse_View_All_Items" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
    <asp:ListView ID="ListView1" runat="server" DataSourceID="LinqDataSource1">
        <ItemTemplate>
            <tr style="line-height:1.5;">
                <td>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "ItemId", "~/Browse/Item.aspx?query={0}")%>'> <%# DataBinder.Eval(Container.DataItem, "ItemTitle") %></asp:HyperLink>
                </td>
                <td>
                    <%--<asp:Label ID="SeriesIdLabel" runat="server" Text='<%# Eval("SeriesId") %>' />--%>
                    <asp:Button ID="btnDownload" runat="server" Text="Download" />
                </td>
            </tr>
        </ItemTemplate>
        <AlternatingItemTemplate>
            <tr style="line-height:1.7; background:#C0C0C0;">
                <td>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "ItemId", "~/Browse/Item.aspx?query={0}")%>'> <%# DataBinder.Eval(Container.DataItem, "ItemTitle") %></asp:HyperLink>
                </td>
                <td>
                    <%--<asp:Label ID="SeriesIdLabel" runat="server" Text='<%# Eval("SeriesId") %>' />--%>
                    <asp:Button ID="btnDownload" runat="server" Text="Download" />
                </td>
            </tr>
        </AlternatingItemTemplate>
        <EmptyDataTemplate>
            <table runat="server" style="">
                <tr>
                    <td>
                        No data was returned.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <InsertItemTemplate>
            <tr style="">
                <td>
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                        Text="Insert" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Clear" />
                </td>
                <td>
                    <asp:TextBox ID="ItemTitleTextBox" runat="server" 
                        Text='<%# Bind("ItemTitle") %>' />
                </td>
                <td>
                    <%--<asp:TextBox ID="SeriesIdTextBox" runat="server" 
                        Text='<%# Bind("SeriesId") %>' />--%>
                </td>
            </tr>
        </InsertItemTemplate>
        <LayoutTemplate>
            <table runat="server">
                <tr runat="server">
                    <td runat="server">
                        <table ID="itemPlaceholderContainer" runat="server" border="0" style="">
                            <tr runat="server" style="">
                                <th runat="server">
                                    ItemTitle</th>
                                <%--<th runat="server">
                                    SeriesId</th>--%>
                            </tr>
                            <tr ID="itemPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server">
                    <td runat="server" style="">
                        <asp:DataPager ID="DataPager2" runat="server" PageSize="25">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                            </Fields>
                        </asp:DataPager>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <EditItemTemplate>
            <tr style="">
                <td>
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                        Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Cancel" />
                </td>
                <td>
                    <asp:TextBox ID="ItemTitleTextBox" runat="server" 
                        Text='<%# Bind("ItemTitle") %>' />
                </td>
                <td>
                    <%--<asp:TextBox ID="SeriesIdTextBox" runat="server" 
                        Text='<%# Bind("SeriesId") %>' />--%>
                </td>
            </tr>
        </EditItemTemplate>
        <SelectedItemTemplate>
            <tr style="">
                <td>
                    <asp:Label ID="ItemTitleLabel" runat="server" Text='<%# Eval("ItemTitle") %>' />
                </td>
                <td>
                    <%--<asp:Label ID="SeriesIdLabel" runat="server" Text='<%# Eval("SeriesId") %>' />--%>
                    
                </td>
            </tr>
        </SelectedItemTemplate>
    </asp:ListView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="PublicCatalogDataContext" Select="new (ItemTitle, SeriesId, ItemId)" 
        TableName="Items" Where="SeriesId == @SeriesId">
        <WhereParameters>
            <asp:QueryStringParameter Name="SeriesId" QueryStringField="query" 
                Type="Int32" />
        </WhereParameters>
    </asp:LinqDataSource>
    </asp:Content>

